﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
	<CustomAction
		Id="Ribbon.DialogHelper.Script"
		Location="ScriptLink"
		ScriptSrc="/_layouts/BoldBrick.SharePoint.CommonControls/JS/DialogHelper.js"
	/>
	<CustomAction
		Id="Ribbon.Positions.Script"
		Location="ScriptLink"
		ScriptSrc="/_layouts/BoldBrick.OneIntranet.HR/JS/Positions.js"
	/>

	<CustomAction Id="Ribbon.Position.Open"
		RegistrationId="0x0100778DF92A0172F041944DD13435237073"
		RegistrationType="ContentType"
		Location="CommandUI.Ribbon"
		Title="$Resources: BoldBrick.OneIntranet.HR, Ribbon_Position_Open_Title"
	>
		<CommandUIExtension>
			<CommandUIDefinitions>
				<CommandUIDefinition Location="Ribbon.ListItem.Manage.Controls._children">
					<Button Id="Ribbon.Position.Open.Button"
							LabelText="$Resources: BoldBrick.OneIntranet.HR, Ribbon_Position_Open_Title_LabelText"
							TemplateAlias="o1"
							Image32by32="/_layouts/images/allcontent32.PNG"
							Sequence="31"
							Command="Command.Ribbon.Position.Open" />
				</CommandUIDefinition>
			</CommandUIDefinitions>
			<CommandUIHandlers>
				<CommandUIHandler Command="Command.Ribbon.Position.Open"
								  CommandAction="javascript:ShowDialog('{SiteUrl}/_layouts/BoldBrick.OneIntranet.HR/OpenPositionPage.aspx', escape(window.location), '{ListId}', SP.ListOperation.Selection.getSelectedItems(), 0);"
								  EnabledScript="javascript:CanOpenPosition();"
								  />
			</CommandUIHandlers>
		</CommandUIExtension>
	</CustomAction>

	<CustomAction Id="Ribbon.Position.Close"
			RegistrationId="0x0100778DF92A0172F041944DD13435237073"
			RegistrationType="ContentType"
			Location="CommandUI.Ribbon"
			Title="$Resources: BoldBrick.OneIntranet.HR, Ribbon_Position_Close_Title"
	>
		<CommandUIExtension>
			<CommandUIDefinitions>
				<CommandUIDefinition Location="Ribbon.ListItem.Manage.Controls._children">
					<Button Id="Ribbon.Position.Close.Button"
							LabelText="$Resources: BoldBrick.OneIntranet.HR, Ribbon_Position_Close_Title_LabelText"
							TemplateAlias="o1"
							Image32by32="/_layouts/images/allcontent32.PNG"
							Sequence="32"
							Command="Command.Ribbon.Position.Close" />
				</CommandUIDefinition>
			</CommandUIDefinitions>
			<CommandUIHandlers>
				<CommandUIHandler Command="Command.Ribbon.Position.Close"
								  CommandAction="javascript:ShowDialog('{SiteUrl}/_layouts/BoldBrick.OneIntranet.HR/ClosePositionPage.aspx', escape(window.location), '{ListId}', SP.ListOperation.Selection.getSelectedItems(), 0);"
								  EnabledScript="javascript:CanClosePosition();"
								  />
			</CommandUIHandlers>
		</CommandUIExtension>
	</CustomAction>

	<CustomAction Id="Ribbon.Position.Copy"
			RegistrationId="0x0100778DF92A0172F041944DD13435237073"
			RegistrationType="ContentType"
			Location="CommandUI.Ribbon"
			Title="$Resources: BoldBrick.OneIntranet.HR, Ribbon_Position_Copy_Title"
	>
		<CommandUIExtension>
			<CommandUIDefinitions>
				<CommandUIDefinition Location="Ribbon.ListItem.Manage.Controls._children">
					<Button Id="Ribbon.Position.Copy.Button"
							LabelText="$Resources: BoldBrick.OneIntranet.HR, Ribbon_Position_Copy_Title_LabelText"
							TemplateAlias="o1"
							Image32by32="/_layouts/images/allcontent32.png"
							Sequence="33"
							Command="Command.Ribbon.Position.Copy" />
				</CommandUIDefinition>
			</CommandUIDefinitions>
			<CommandUIHandlers>
				<CommandUIHandler Command="Command.Ribbon.Position.Copy"
								  CommandAction="javascript:ShowDialog('{SiteUrl}/_layouts/BoldBrick.OneIntranet.HR/CopyPositionPage.aspx', escape(window.location), '{ListId}', SP.ListOperation.Selection.getSelectedItems(), 0);"
								  EnabledScript="javascript:CanCopyPosition();"
								  />
			</CommandUIHandlers>
		</CommandUIExtension>
	</CustomAction>
</Elements>